Skip to content

fix(archil)!: catch Archil errors by their error code - #3154

Merged
sam-goodwin merged 14 commits into
alchemy-run:mainfrom
dallenpyrah:fix/archil-error-code-and-message
Nov 8, 2026
Merged

sam-goodwin merged 14 commits into
alchemy-run:mainfrom
dallenpyrah:fix/archil-error-code-and-message

Conversation

@dallenpyrah

@dallenpyrah dallenpyrah commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Archil's errors arrive as one tag per Archil error code (alchemy-run/distilled#1091), and alchemy stops building distilled errors with codes it made up.

 yield* archil.getSandbox({ sid }).pipe(
-  Effect.catchTag("SandboxNotFound", () => Effect.undefined),
+  Effect.catchTag("NotFound", () => Effect.undefined),
 );

 archil.createSandbox(request).pipe(
-  Effect.catchTag("SandboxAlreadyExists", () =>
+  Effect.catchTag("SandboxNameConflict", (conflict) =>
     findSandboxByName(name).pipe(
-      Effect.flatMap((found) => found ? Effect.succeed(found)
-        : Effect.fail(new archil.SandboxAlreadyExists({ error: `Sandbox ${name} exists…` }))),
+      Effect.flatMap((found) => (found ? Effect.succeed(found) : Effect.fail(conflict))),
     ),
   ),
 );

A disk Archil reports as created without an id is alchemy's own error, not a fake DiskNotFound that callers treat as "already gone":

export class DiskIdMissing extends Data.TaggedError("Archil.DiskIdMissing")<{
  readonly diskName: string;
}> {}

A paused sandbox refuses connections with SandboxTerminated, which is what the resume-and-retry path now catches. Booting a program sandbox ignores SandboxStartConflict. SandboxPausing and SandboxStopping are retried by the SDK. A branch create that loses a race recovers through Conflict (alchemy-run/distilled#1093), and BranchDisk.branch now goes through the same path, so concurrent branch({ name }) calls return one branch instead of failing all but the first, and the DiskAlreadyExists catch is gone: createDisk returns the existing disk for a taken name.

Bumps submodules/distilled to distilled main with alchemy-run/distilled#1091 and alchemy-run/distilled#1093.

dallenpyrah and others added 2 commits November 7, 2026 10:48
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@alchemy-version-bot

alchemy-version-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Install the packages built from this commit:

alchemy

pnpm install https://pkg.alchemy.run/alchemy/pr:3154:6c9e293
@alchemy.run (33)
pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/git/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/drizzle/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/acme/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/archil/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/boat/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/axiom/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/doppler/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/infisical/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/turso/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/e2b/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/daytona/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/modal/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/planetscale/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/neon/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/prisma/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/hetzner/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/railway/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/fly/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/github/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/stripe/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/gcp/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/aws/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/domain/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/kubernetes/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/docker/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/redis/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/sql/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:3154:6c9e293
Transitive Dependencies (25)
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/archil/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/boat-dev/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/axiom/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/doppler/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/infisical/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/turso/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/e2b/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/daytona/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/modal/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/s3/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/prisma/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/hetzner/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/railway/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/fly-io/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/stripe/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:3154:6c9e293
pnpm install https://pkg.alchemy.run/@distilled.cloud/gcp/pr:3154:6c9e293

Published Nov 8, 2026, 2:25 AM UTC. Expires Nov 15, 2026, 2:25 AM UTC, extended while this pull request is open.

@sam-goodwin sam-goodwin changed the title fix(archil): build Archil errors with code and message fix(archil)!: catch Archil errors by their error code Nov 8, 2026
@sam-goodwin
sam-goodwin merged commit 88b63c9 into alchemy-run:main Nov 8, 2026
7 checks passed
sam-goodwin added a commit that referenced this pull request Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants